function NetworkUtils(){
   
    var timeoutTime = 20000;
    var handleResponseFunction = new Array();
    var request = new Array();
    var timeout = new Array();
   
    this.makeHttpRequest = function (url, requestMethod, args, returnType, responseFunction, responseFunctionArgs){
        handleResponseFunction[url] = function(response) {
                responseFunction(response, responseFunctionArgs)
          };
        try{
            var attributeList = null;
            if ((args != undefined) && (args != null)){
                var attributeList = "";
                var index = 0;
                for(var i in args){
                    attributeList += ((index==0) ? "" : "&") + i + "=" + encodeURIComponent(args[i]);
                    index++;
                }
            }
           
            // request initialization
            request[url] = new XMLHttpRequest();
            request[url].onreadystatechange = function () {
                if ( this.readyState == 4 ) {
                    switch ( this.status ) {
                        case 200:
                            handleResponse(url, returnType);
                            break;
                    }
                }
            }
           
            if (requestMethod == "POST"){
                request[url].open("POST", url, true);
            } else {
                request[url].open("GET", url, true);
            }
           
            // request header
            request[url].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            request[url].setRequestHeader("Cache-Control", "no-cache");
           
            request[url].send(attributeList);
           
            timeout[url] = setTimeout(function(){ timeoutHandler(url); }, timeoutTime);
           
        } catch (err){
            handleResponseFunction[url]("Error: "+err);
        }
       
    }
   
    function handleResponse(url, returnType){
       
        clearTimeout(timeout[url]);

        // callback
        if (request[url].responseText == null){
            handleResponseFunction[url]("networkError");
        } else {
            if (returnType == "XML"){
                handleResponseFunction[url](request[url].responseXML);
            } else {
                handleResponseFunction[url](request[url].responseText);
            }
        }
     
    }
   
    /**
    * Timeout function
    *
    * @param  url        requested URL
    */
    function timeoutHandler(url){
        // callback
        handleResponseFunction[url]("networkError");
       
    }

}